package com.eureka.asyn.service;

import com.eureka.asyn.entity.BaseFileEntity;
import com.eureka.bclass.base.BaseResult;
import com.eureka.bclass.base.BaseUploadResult;
import org.springframework.scheduling.annotation.Async;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.concurrent.CompletableFuture;

/**
 * @description: 文件接口
 * @author: lixing
 * @time: 2021/6/6 12:31
 */
public interface FileService {
    /**
     * @Description 上传文件
     * @Author lixing
     * @Date 2019/10/4 21:38
     */
    @Async("api-asyn-taskExecutor")
    CompletableFuture<BaseResult<BaseUploadResult>> upload(BaseFileEntity baseEntity);

    /**
     * @Description 下载文件
     * @Author lixing
     * @Date 2020/12/12 18:50
     */
    void down(BaseFileEntity baseEntity, HttpServletRequest request, HttpServletResponse response) throws Exception;
}
